<template>
  <ButtonGroup title="说明类型" :status="`${status[currentStatus]}`">
    <el-button-group>
      <el-button
        @click="changeTextType(0)"
        :class="{
          select: currentStatus === 0,
        }"
      >
        <font-awesome-icon icon="heading" />
      </el-button>
      <el-button
        @click="changeTextType(1)"
        :class="{
          select: currentStatus === 1,
        }"
      >
        <font-awesome-icon icon="paragraph" />
      </el-button>
    </el-button-group>
  </ButtonGroup>
</template>
<script setup>
import { inject } from 'vue';
import ButtonGroup from './ButtonGroup.vue';
const props = defineProps({
  status: Array,
  configKey: String,
  currentStatus: Number,
});

const updateStatus = inject('updateStatus', () => {});

const changeTextType = (pos) => {
  if (updateStatus) {
    updateStatus(props.configKey, { value: pos, TextType: true });
  }
};
</script>
